#include "channel_client.hpp"
#include "client_impl.hpp"

namespace fasys{ namespace client{ namespace channel{

channel_client::~channel_client()
{
  delete _client;
}

channel_client::channel_client()
  : _client(new client_impl)
{
}

void channel_client::start(fas::mux::imux<>* mux, const client_config& conf)
{
  _client->close();
  _client->set_nonblock(true/*, true*/);
  _client->set_mux(mux);
  _client->connect("127.0.0.1", 12345);
  // _client->outgoing(subscribe());
}

void channel_client::callback(iclient_callback* cb)
{
  _client->callback = cb;
}

void channel_client::send(const message_publish& cmd)
{
  //
  _client->outgoing(cmd);
}

void channel_client::send(const subscribe_request& cmd)
{
  _client->outgoing(cmd);
}



void channel_client::stop()
{
}

}}}
